home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / aijournl / 1986_09 / cli.pdr < prev    next >
Text File  |  1986-06-07  |  1KB  |  32 lines

  1.  
  2. CLI LISP Synchronized Producer and Consumer Tasks
  3.  
  4.  
  5.         PRODUCER - CONSUMER
  6.           - empty the buffer
  7.           - create a list of information for the example
  8.             (could be read in)
  9.           - initialize the semaphores
  10.             ($ok-to-produce  $ok-to-consume)
  11.           - start the concurrent producer and consumer tasks
  12.  
  13.         PRODUCER
  14.           - repeat until the information is exhausted
  15.               - wait until the buffer is empty
  16.                 (using semaphore $ok-to-produce)
  17.                 (this suspends PRODUCER)
  18.               - fill the buffer
  19.               - signal that the buffer is full
  20.                 (using semaphore $ok-to-consume)
  21.                 (this wakes up CONSUMER)
  22.  
  23.         CONSUMER
  24.           - repeat until the information is exhausted
  25.               - wait until the buffer is full
  26.                 (using semaphore $ok-to-consume)
  27.                 (this suspends CONSUMER)
  28.               - access the buffer
  29.               - signal that the buffer is empty
  30.                 (using semaphore $ok-to-produce)
  31.                 (this wakes up PRODUCER)è
  32.